package net.joey.proxy.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class TestMain {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		try {
			ClassLoader cl = Thread.currentThread().getContextClassLoader();
			Class c = cl.loadClass("net.joey.proxy.annotation.RuntimeClass");
			Method testRuntime = c.getMethod("test");
			Class cr = cl.loadClass("net.joey.proxy.annotation.RuntimeA");
//			RuntimeA ra =  (RuntimeA) testRuntime.getAnnotation(RuntimeA.class);
			RuntimeA ra =  (RuntimeA) testRuntime.getAnnotation(cr);
			
			System.out.println(ra.annotationType());
			System.out.println(ra.name());
			System.out.println(ra.value());
			System.out.println(ra.color());
			System.out.println(ra.ids());
			System.out.println(cr.getName());
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
